# 一、猜数字
import random
number = random.randint(1,20)
print('猜数：')
for i in range(1,7):
    guess = int(input())
    if guess > number:
        print('It is too larger!')
    elif guess < number:
        print('It is too small!')
    else:
        break # correct
if guess == number:
    print("It's very good!")
else:
    print('No , The number is'+ str(number) + '!')

# 二、Collatz 序列
def  collatz(number):
    try:
        if number % 2 ==0:
            print('number // 2')
            result = number // 2
        elif number % 2 == 1:
            print('3 * number +1')
            result = 3 * number +1
    except ValueError:
        print('请输入整数！')
        result = number
    return result
flag = True
while flag:
    try:
        param = int(input('param a number,in end of 1:'))
        result =  collatz(param)
        print(result)
        if result == 1:
            flag = False
            print(result)
    except ValueError:
        print('请输入整数！')
        
    
    
         
    
